return TRUE;
}
-
/**
* ostree_repo_prune_static_deltas:
* @self: Repo
return FALSE;
}
- objects = ostree_repo_list_objects_set (self, OSTREE_REPO_LIST_OBJECTS_ALL | OSTREE_REPO_LIST_OBJECTS_NO_PARENTS,
+ if (commit_only)
+ {
+ if (!ostree_repo_list_commit_objects_starting_with (self, "", &objects, cancellable, error))
+ return FALSE;
+ }
+ else
+ {
+ objects = ostree_repo_list_objects_set (self, OSTREE_REPO_LIST_OBJECTS_ALL | OSTREE_REPO_LIST_OBJECTS_NO_PARENTS,
cancellable, error);
+ }
+
if (!objects)
return FALSE;
if (!lock)
return FALSE;
- g_autoptr(GHashTable) objects =
- ostree_repo_list_objects_set (self, OSTREE_REPO_LIST_OBJECTS_ALL | OSTREE_REPO_LIST_OBJECTS_NO_PARENTS,
- cancellable, error);
+ g_autoptr(GHashTable) objects = NULL;
+ OstreeRepoPruneFlags flags = options->flags;
+ gboolean commit_only = (flags & OSTREE_REPO_PRUNE_FLAGS_COMMIT_ONLY) > 0;
+ if (commit_only)
+ {
+ if (!ostree_repo_list_commit_objects_starting_with (self, "", &objects, cancellable, error))
+ return FALSE;
+ }
+ else
+ {
+ objects =
+ ostree_repo_list_objects_set (self, OSTREE_REPO_LIST_OBJECTS_ALL | OSTREE_REPO_LIST_OBJECTS_NO_PARENTS,
+ cancellable, error);
+ }
if (!objects)
return FALSE;
* OstreeRepoPruneFlags:
* @OSTREE_REPO_PRUNE_FLAGS_NONE: No special options for pruning
* @OSTREE_REPO_PRUNE_FLAGS_NO_PRUNE: Don't actually delete objects
- * @OSTREE_REPO_PRUNE_FLAGS_REFS_ONLY: Do not traverse individual commit objects, only follow refs
+ * @OSTREE_REPO_PRUNE_FLAGS_REFS_ONLY: Do not traverse individual commit objects, only follow refs for reachability calculations
* @OSTREE_REPO_PRUNE_FLAGS_COMMIT_ONLY: Only traverse commit objects. (Since 2022.2)
*/
typedef enum {